//
//  UWFriendManager.h
//  Urban Words
//
//  Created by Tim Brandin on 2011-11-21.
//  Copyright (c) 2011 Sypreme. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "sqlite3.h"
#import "Facebook.h"
#import "UWFriendDelegate.h"
#import "UWFriend.h"
#import "UWFriendDetail.h"

@interface UWFriendManager : NSObject <FBRequestDelegate> {
    sqlite3 *friendsDB;
    
    NSString *dbPath;
    
    NSMutableArray *delegates;
    
    NSDate *lastUpdated;
}

@property (retain, nonatomic) id delegate;

@property (readonly) NSInteger count;
@property (readonly) NSInteger sections;

@property (retain, nonatomic) Facebook *facebook;

- (UWFriend *)getFriendAt:(NSInteger)row;
- (UWFriend *)getFriendAt:(NSInteger)row atSection:(NSInteger)section;
- (UWFriend *)getFullFriendAt:(NSInteger)row atSection:(NSInteger)section;
- (UWFriend *)getFullFriendWithFID:(NSString *)fid;
- (UWFriend *)getFriend:(NSString *)fid;
- (void)getHighscoreOfFriend:(NSString *)fid;
- (NSString *)getSectionAt:(NSInteger)index;
- (NSInteger)countAtSection:(NSInteger)section;
- (NSArray *)getAllSections;
+ (UWFriendManager *)sharedManager;
- (void)updateFriends;
- (void)downloadImage:(UWFriend *)person;
- (UIImage *)getLargeImage:(UWFriend *)person;
- (void)unsetDelegate:(id)object;
- (void)clear;
- (void)parseDataForHighscore:(NSData *)data delegate:(UWFriendDetail *)delegate;

@end
